# -*- coding: utf-8 -*-
from django.db import models


class BaseModel(models.Model):
    
    def get_disabled_desc(self, disabled):
        return '启用' if disabled == 0 else '禁用'
        
    class Meta:
        abstract = True


class CreatedAndUpdatedModel(BaseModel):
    
    created_at = models.DateTimeField('创建时间', null=False, auto_now_add=True, auto_now=False)
    updated_at = models.DateTimeField('修改时间', null=False, auto_now_add=False, auto_now=True)

    class Meta:
        abstract = True  